/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("tb_project_reviewspecial_group",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using MYData.Entity.DomainModels;
using MYData.System.IServices;
using System.Net;
using MYData.Core.Utilities;
using MYData.Core.BaseProvider;
using MYData.Entity.DomainModels.ApiEntity.Input;
using MYData.System.Services;
using MYData.Entity.DomainModels.ApiEntity.detail;
using Mapster.Utils;
using MYData.Core.Extensions;
using Microsoft.AspNetCore.Authorization;

namespace MYData.System.Controllers
{
    public partial class tb_project_reviewspecial_groupController
    {
        private readonly Itb_project_reviewspecial_groupService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;

        [ActivatorUtilitiesConstructor]
        public tb_project_reviewspecial_groupController(
            Itb_project_reviewspecial_groupService service,
            IHttpContextAccessor httpContextAccessor
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
        }


        /// <summary>
        /// 专家组显示
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        /// WJQ 2023/4/6
        [HttpPost, Route("GetList")]
        public async Task<object> GetList()
        {
            return await _service.GetList();
        }

        /// <summary>
        /// 专家组逻辑删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        /// WJQ 2023/4/6
        [HttpPost, Route("DeleteList")]
        public async Task<object> DeleteList(string id)
        {
            return await _service.DeleteList(id);
        }

        /// <summary>
        /// 专家组详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        /// WJQ 2023/4/6
        [HttpPost, Route("DetailInfo")]
        [AllowAnonymous]
        public async Task<object> DetailInfo(string id)
        {
            return await _service.DetailInfo(id);
        }

        /// <summary>
        /// 专家组修改
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        /// WJQ 2023/4/7
        [HttpPost, Route("UpdateInfo")]
        public IActionResult UpdateInfo([FromBody]groupExpertDetail_Dto dto)
        {
            return Json(_service.UpdateInfo(dto));
        }
        /// <summary>
        /// 专家组下拉框显示
        /// </summary>
        /// <returns></returns>
        ///WJQ 2023/4/7
        [HttpGet, Route("SelectList")]
        public async Task<object> SelectList()
        {
            return await _service.SelectList();
        }
        /// <summary>
        /// 专家组名称不能重复
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        [HttpPost("QueryName")]
        public async Task<object> QueryName(string name)
        {
            return await _service.QueryName(name);
        }
    }
}
